// 格式化时间
export function formatDateTime(dateTimeString, type) {
  // debugger
  const dateTime = new Date(dateTimeString);
  const year = dateTime.getFullYear();
  const month = String(dateTime.getMonth() + 1).padStart(2, '0');
  const date = String(dateTime.getDate()).padStart(2, '0');
  const hours = String(dateTime.getHours()).padStart(2, '0');
  const minutes = String(dateTime.getMinutes()).padStart(2, '0');
  const seconds = String(dateTime.getSeconds()).padStart(2, '0');
  if (type) {
    return `${year}-${month}-${date} ${hours}:${minutes}:${seconds}`
  } else {
    return {
      hours,
      minutes,
      seconds
    }
  }
}